<?php $this->pageTitle = 'Cancel Invoice'; ?>
<script>
	var existingReceipt = <?php echo ($existingReceipt) ? $existingReceipt : "null"; ?>;
</script>
<div class="flat_area">
	<?php
	$form = $this->beginWidget('PsActiveForm', array(
		'id' => 'cancel-invoice-form',
		'action' => $this->createUrl('invoice/cancel', array('id' => $invoice->id, 'confirm' => true)),
		'enableAjaxValidation' => false,
		'enableClientValidation' => true,
		'clientOptions' => array(
			'validationDelay' => 200,
			'inputContainer' => 'tr',
			'validateOnSubmit' => true,
			'validateOnChange' => false,
		)
			));
	?>
    <div class="grid_16 content_header clearfix">
        <h1 class="float-left">Cancel Invoice</h1>
    </div>
    <div class="grid_16 relative">
        <table class="form-table">
            <tr>
                <td>
                    <strong>Please enter a reason for canceling:</strong><br/>
					<?php echo $form->textarea($invoice, 'delete_reason', array('style' => 'width: 100%;')); ?>
					<?php echo $form->error($invoice, 'delete_reason'); ?></strong>
                </td>
            </tr>
        </table>


        <br/>
    </div>
    <div class="grid_16 relative">
		<a href="<?php echo $this->createUrl('invoice/view', array('id' => $invoice->id)); ?>" class="link-button with-icon">Cancel</a>
        <button type="submit" class="link-button no-margin with-icon" id="btnCancelInvoice">
            <img height="16" width="16" alt="Bended Arrow Right" src="/images/icons/fugue/cross.png" /><span>Cancel Invoice</span>
        </button>
    </div>
	<?php $this->endWidget(); ?>
</div>
<?php
	$this->renderPartial('_dialog_cancel_invoice_deny', array(
	));
?>